<template>
  <div class="test">
    <QfForm
      width="80px"
      :formConfig="formConfig"
      :formBtns="formBtns"
      @submit="submit2Fn"
    ></QfForm>
  </div>
</template>

<script>
export default {
  methods: {
    submit2Fn(data) {
      console.log(data);
    },
    submitFn() {
      this.$refs.form3.validate((isSuccess) => {
        if (isSuccess) {
          this.$notify({
            title: "成功",
            message: "验证通过，待写发送异步请求",
            type: "success",
          });
        }
      });
    },
    resetFn() {
      this.$refs.form3.resetFields();
    },
  },
  data() {
    return {
      formData: {
        uname: "",
        pwd: "",
      },
      formBtns: [
        {
          content: "登录",
          type: "primary",
        },
        {
          content: "重置",
          type: "",
        },
      ],
      formConfig: [
        {
          label: "账号",
          width: "",
          field: "uname",
          type: "text",
          rules: [
            { required: true, message: "账号不能为空", trigger: "blur" },
            { min: 3, max: 6, message: "长度在3~6个字符之间", trigger: "blur" },
          ],
        },
        {
          label: "密码",
          width: "",
          field: "pwd",
          type: "password",
          rules: [{ required: true, message: "密码不能为空", trigger: "blur" }],
        },
      ],
    };
  },
};
</script>

<style></style>
